/***************************************************************************
 *   Copyright (C) 2006 by Grzegorz Latarowski                             *
 *   g.latarowski@gmail.com                                                *
 *                                                                         *
 *   Project: AutoStop (kodowa nazwa do zmiany)                            *
 *                                                                         *
 ***************************************************************************/



#ifndef GMOVIEPLAYER_H
#define GMOVIEPLAYER_H

#include <QDialog>

class QCheckBox;
class QGridLayout;
class QHBoxLayout;
class QLabel;
class QMovie;
class QSlider;
class QSpinBox;
class QToolButton;
class QVBoxLayout;



// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
class GMoviePlayer : public QDialog
{
Q_OBJECT

public:
    GMoviePlayer(QWidget *parent = 0);
    GMoviePlayer(QString fileName, QWidget *parent = 0);

private slots:
    void open();
    void goToFrame(int frame);
    void fitToWindow();
    void updateButtons();
    void updateFrameSlider();
    void updateFrameBox(int frameNumber);

private:
    void createControls();
    void createButtons();
    void createMovieWindow();

    QString currentMovieDirectory;
    QLabel *movieLabel;
    QMovie *movie;
    QToolButton *openButton;
    QToolButton *playButton;
    QToolButton *pauseButton;
    QToolButton *stopButton;
    QToolButton *quitButton;
    QCheckBox *fitCheckBox;
    QSlider *frameSlider;
    QSpinBox *speedSpinBox;
    QLabel *frameLabel;
    QLabel *speedLabel;
    QLabel *frameBox;

    QGridLayout *controlsLayout;
    QHBoxLayout *buttonsLayout;
    QVBoxLayout *mainLayout;
};
// ---------------------------------------------------------------------------

#endif // GMOVIEPLAYER_H


